-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(testing): revert change & fix playwright tests #4310
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4310 +/- ##
==========================================
- Coverage 68.22% 66.21% -2.01%
==========================================
Files 31 31
Lines 1586 1619 +33
Branches 308 316 +8
==========================================
- Hits 1082 1072 -10
- Misses 430 469 +39
- Partials 74 78 +4
Continue to review full report at Codecov.
|
✨ Coder.com for PR #4310 deployed! It will be updated on every commit.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, insidious.... Nice work finding this!
While the test runner is fixed, the e2e tests are either failing or timing out See logs: https://github.com/cdr/code-server/pull/4310/checks?check_run_id=3808423259#step:10:37 I took a look at the failed videos. It appears code-server isn't even starting up. Converting back to draft so I can fix this. |
This test was originally added to ensure playwright was working. At this point, we know it works so removing this test because it doesn't help with anything specific to code-server and only adds unnecessary code to the codebase plus increases the e2e test job duration.
I don't know if it's a resources issue, playwright, or code-server but it seems like the e2e tests choke when multiple workers are used. This change is okay because our CI runner only has 2 cores so it would only use 1 worker anyway, but by specifying it in our playwright config, we ensure more stability in our e2e tests working correctly. See these PRs: - #3263 - #4310
783a1d6
to
3f48ba7
Compare
3f48ba7
to
910a7cd
Compare
Hmm, the tests are still failing 🤔 Thinking out loud, the main difference is that when I run them locally, I run I'm currently working with @code-asher to see if I can reproduce locally on macOS. EDIT: Yup, we can reproduce locally |
910a7cd
to
0b080f5
Compare
d5b4f64
to
b4bda04
Compare
Our code has new dependencies on VS Code that are pulled in when the unit tests run. Because of this we need to build VS Code before running the unit tests (as it only pulls built code).
This resolves a security report with one of its dependencies (vm2).
This is necessary now that we import from the out directory.
These were renamed so the cached paths need to be updated. I changed the key as well to force a rebuild.
This way it works for local testing as well. I had to use out-build instead of out-vscode-server-min because Jest throws some obscure error about a handlebars haste map.
8fb7340
to
8a9fe9a
Compare
It contains fixes for missing files in the build.
Shares code with the test HTTP server. For now it is a function but maybe we should make it a class that is extended by tests.
8a9fe9a
to
070d131
Compare
Unfortunately the logger currently chokes when provided with error objects. Also for some reason the bracketed text was not displaying...
f297b7a
to
f8528fa
Compare
The address was recently changed to use URL which seems to add a trailing slash when using toString, causing the regex match to fail.
f8528fa
to
7a52cb8
Compare
This is used to set cookies when using a base path.
The file this was testing no longer exists.
Since this is a web path and not platform-dependent.
Summary
This PR fixes our e2e tests with a few minor changes to ensure they're reliable again.
Changes
These are the changes worth noting:
type
keyword for import which caused Playwright test runner to fail (see error screenshot)Screenshot of Error
Test Gauntlet Results
We missed these errors because we lost faith in the end-to-end testing CI job due to flakiness in the past. In order to ensure our tests pass The Gauntlet, we ran them in all 3 major browsers x10 each. Here is a chart of the results:
Therefore, we can now mark the
test-e2e
job as required before PRs merge.TODOs
Debugging Notes
Although @bryphe-coder and I used
git bisect
and narrowed it down to this PR/commit: #4010, it appears something downstream/upstream may have changed leading to this break. I couldn't figure out what it was but I was able to narrow the error down to the file changed in this PR. It's weird because our tests passed when that PR was added so I'm not sure what changed? Either way, happy it's fixed now.How I found it
After
git bisect
helped me determine the offending file, I then went to the commit before it withgit checkout beebf53adc0a7c51d63c27b4981a4b381334b820
and then one by one, I checked out different files (55 files changed)until I figured out which one it was.Steps:
git bisect
until you find bad commitgit checkout <commit-SHA>
of good commit before bad commitgit checkout <bad-commit-SHA> -- <file>
one by one until finding the bad file.Note: I also sped up the process by checking out whole directories i.e.
git checkout d8c344beda423d4af131ad213e982a4f4dc6387c src
. That's how I realized it was in the/src
directory.From there, I commented out different lines until I figured out what was wrong.
Turns out all the login tests are failing because we removed the redirect logic here.
Should be fine to specify this I think in the playwright config.
Relevant Links:
Fixes #4342